﻿using Coldairarrow.Entity.BackStage.ConsumeChats;
using Coldairarrow.Util;
using Coldairarrow.Util.DTO;
using Coldairarrow.Util.DTO.OnlineChat;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.BackStage.ConsumeChats
{
    public interface IChatRoomBusiness
    {
        Task<PageResult<ChatRoom>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<ChatRoom> GetTheDataAsync(string id);
        List<object> GetUserLogSumDTO();
        Task AddDataAsync(ChatRoom data);
        Task UpdateDataAsync(ChatRoom data);
        Task DeleteDataAsync(List<string> ids);
        ChatBigScreenData GetBigScreenData(GetBSInput input);
        Task<List<SelectDTO>> GetPlatformListAsync();
        Task<List<SelectDTO>> GetCSSeverListAsync(GetCSSeversInput input);
        Task<PageResult<TheRoomDTO>> GetTheRoomListAsync(PageInput<GetRoomListInput> input);
        Task<PageResult<ChatLogDTO>> GetTheChatLogListAsync(PageInput<GetCSChatLogsInput> input);

    }

    public class GetCSSeversInput
    {
        /// <summary>
        /// 平台类型
        /// </summary>
        public int PClassId { get; set; } = -1;

        public DateTime? StartTime { get; set; }

        public DateTime? EndTime { get; set; }

    }

    public class GetRoomListInput
    {
        /// <summary>
        /// 平台类型
        /// </summary>
        public int PClassId { get; set; } = -1;

        /// <summary>
        /// 客服Id
        /// </summary>
        public string ConsumeServerId { get; set; }

        public DateTime? StartTime { get; set; }

        public DateTime? EndTime { get; set; }
    }

    public class TheRoomDTO
    {
        public string RoomId { set; get; }

        /// <summary>
        /// 用户Id
        /// </summary>
        public string UserId { set; get; }

        /// <summary>
        /// 用户头像
        /// </summary>
        public string HeadImg { set; get; }

        /// <summary>
        /// 用户头像类型
        /// </summary>
        public int? HeadType { set; get; }

        /// <summary>
        /// 用户名称
        /// </summary>
        public string RoomName { set; get; }

        /// <summary>
        /// 最新消息时间
        /// </summary>
        public DateTime MSTime { set; get; }

        /// <summary>
        /// 最新消息类型
        /// </summary>
        public int messageType { set; get; }

        /// <summary>
        /// 最新消息内容
        /// </summary>
        public string NewMassage { set; get; }

        /// <summary>
        /// 未读消息数量
        /// </summary>
        public int MSCount { set; get; }
    }

    public class GetCSChatLogsInput
    {
        /// <summary>
        /// 平台类型
        /// </summary>
        public int PClassId { get; set; } = -1;

        /// <summary>
        /// 客服Id
        /// </summary>
        public string ConsumeServerId { get; set; }

        /// <summary>
        /// 房间Id
        /// </summary>
        public string CharRoomId { get; set; }

        public DateTime? StartTime { get; set; }

        public DateTime? EndTime { get; set; }
    }

    public class GetBSInput
    {
        public int? Year { set; get; }

        public int? Month { set; get; }
    }

    public class ChatBigScreenData
    {
        public List<string> NameList { set; get; }

        public List<int> DataList { set; get; }
    }
}